package com.hospital.schedule.module.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hospital.common.dto.schedule.module.*;
import com.hospital.common.pojo.TDoctorLeaveRecord;
import com.hospital.common.pojo.TDoctorSchedule;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 排班表 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2025-09-11
 */
public interface TDoctorScheduleMapper extends BaseMapper<TDoctorSchedule> {

    List<TDoctorSchedule> findDoctorScheduleByDoctor
            (FindDoctorScheduleByDoctorDto findDoctorScheduleByDoctorDto);

    List<TDoctorSchedule> findDoctorScheduleByAdmin(FindDoctorScheduleByAdminDto findDoctorScheduleByAdminDto);

    Integer updateScheduleByLeaveRecord(TDoctorLeaveRecord tDoctorLeaveRecord);

    Integer updateScheduleByAgreeLeaveRecord(TDoctorLeaveRecord doctorLeaveRecord);

    Integer updateScheduleByRefuseLeaveRecord(TDoctorLeaveRecord tDoctorLeaveRecord);

    Integer disagreeLeaveRecordByAdmin(TDoctorLeaveRecord tDoctorLeaveRecord);

    List<TDoctorSchedule> findDoctorScheduleByAttend(AddDoctorAttendanceDto addDoctorAttendanceDto);

    List<Long> findDoctorId(@Param("formatToEndOfDay") String formatToEndOfDay
            ,@Param("formatToStartOfDay") String formatToStartOfDay);

    List<Long> fineDoctorByDoctorSchedule(@Param("departmentId") Long departmentId
            ,@Param("startTime") String startTime
            ,@Param("endTime") String endTime);

    List<TDoctorSchedule> findDoctorScheduleByTime(FindDoctorScheduleByTimeDto findDoctorScheduleByTimeDto);

    Integer fineDoctorBySchedule(FindDoctorScheduleOfScheduleDto findDoctorScheduleOfScheduleDto);
}
